import { defineStore } from 'pinia'
import { ref } from 'vue'
export const useAdminStore = defineStore('admin', ()=>{
    const token = ref('')
    const adminInfo=ref({})
    const setToken=(newToken)=>{
        token.value=newToken
    }
    const removeToken=()=>{
        token.value=''
    }
   const setAdminInfo=(newAdminInfo)=>{
    adminInfo.value=newAdminInfo
   }
   const removeAdminInfo=()=>{
    adminInfo.value=''
   }
    return {
        token,
        setToken,
        removeToken,
        adminInfo,
        setAdminInfo,
        removeAdminInfo
    }
},{
    persist:true
})